import Vue from 'vue'
import Router from 'vue-router'
import Login from '@/components/login/Login'
import Home from "@/components/home/Home"
import HomeOn from "@/components/home/HomeOn";
import ShopManage from "@/components/shop/ShopManage"
import ShopCategory from "@/components/shop/ShopCategory"
import Order from "@/components/order/Order"
import UserList from "@/components/user/UserList"


Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/login',
      name: 'Login',
      component: Login,
      meta : {title : "登录系统"}
    },
    {
      path: '/',
      name: 'Home',
      component: Home,
      meta:{
        requireAuth:true,
        title : "系统首页"
      },
      children:[
        {
          path: 'homeon',
          name: 'HomeOn',
          component: HomeOn,
          meta:{
            requireAuth:true,
            title : "系统首页/主体部分"
          },
        },
        {
          path: 'shopmanage',
          name: 'ShopManage',
          component: ShopManage,
        },
        {
          path: 'shopcategory',
          name: 'ShopCategory',
          component: ShopCategory,
        },
        {
          path: 'order',
          name: 'Order',
          component: Order,
        },
        {
          path: 'userlist',
          name: 'UserList',
          component: UserList,
        }

      ],
      redirect:"/homeon"
    }

  ]
})
